package com.lottery.im.module.result.adapter.result.statistics;

import android.support.annotation.Nullable;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.lottery.im.R;
import com.lottery.im.api.result.entity.GameHistoryInfo;
import com.lottery.im.util.SpannerUtils;
import java.util.List;

public class History28Adapter extends BaseQuickAdapter<GameHistoryInfo, BaseViewHolder> {

  public History28Adapter(@Nullable List<GameHistoryInfo> data) {
    super(R.layout.item_history_28_list, data);
  }

  @Override protected void convert(BaseViewHolder helper, final GameHistoryInfo item) {
    helper.setText(R.id.tv_history_date, item.getDate());
    helper.setText(R.id.tv_history_sueId, item.getIsSueId());
    List<String> its = item.getStringStr();
    if (its.size() >= 3) {
      helper.setText(R.id.tv_result1, its.get(0));
      helper.setText(R.id.tv_result2, its.get(1));
      helper.setText(R.id.tv_result3, its.get(2));
      helper.setText(R.id.tv_sum, item.getHeZhi());
    }
    helper.setText(R.id.tv_history_he,
        SpannerUtils.stringUtilColor(mContext.getResources().getColor(R.color.red_fa),
            item.getDaXiao(), "大"));
  }
}